package com.wordlearning.app.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.time.LocalDateTime;

@Data
@TableName("voice_settings")
public class VoiceSetting {

    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField(value = "user_id", exist = true)
    private Long userId = 1L; // 默认用户ID

    @TableField(value = "voice_type", exist = true)
    private String voiceType = "male";

    @TableField(value = "speed", exist = true)
    private Double speed = 1.0;

    @TableField(value = "pitch", exist = true)
    private Double pitch = 1.0;

    @TableField(value = "volume", exist = true)
    private Double volume = 1.0;

    @TableField(value = "language_code", exist = true)
    private String languageCode = "en-US";

    @TableField(value = "created_at", exist = true)
    private LocalDateTime createdAt;

    @TableField(value = "updated_at", exist = true)
    private LocalDateTime updatedAt;
    
    // MyBatis-Plus自动填充功能，通过MyMetaObjectHandler实现
    // 不需要手动实现@PrePersist和@PreUpdate方法
}